package cn.sycoder.mapper;

import cn.sycoder.entity.BehaviorLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 杨润发
 * @since 2024-11-04
 */
@Repository
public interface BehaviorLogMapper extends BaseMapper<BehaviorLog> {

    // 通过月份执行分表存储
    @Insert("insert into ${tableName} (user_name,user_id,type,create_time)" +
            "values(#{userName},#{userId},#{type},#{createTime})")
    void insertBehavior(Long userId, String userName, Integer type, String tableName, Date createTime);
}
